package cn.iocoder.yudao.module.engine.service.core.queue.audio;

import cn.iocoder.yudao.module.engine.model.config.EngineConfig;
import cn.iocoder.yudao.module.engine.service.core.queue.audio.impl.NotLimitedAudioQueue;
import cn.iocoder.yudao.module.engine.service.core.queue.audio.impl.PriorityLimitedAudioQueue;
import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;

@Component
public class AudioQueueFactory {
    @Resource
    private EngineConfig engineConfig;

    public AudioQueue getQueue() {
        final String primary = engineConfig.getAudioQueue().getPrimary();
        switch (primary) {
            case "PriorityLimited":
                return new PriorityLimitedAudioQueue();
            case "NotLimited":
                return new NotLimitedAudioQueue();
            default:
                throw new IllegalArgumentException("unknown primary:" + primary);
        }
    }
}